﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using WS1.Models;
using WS1.Repository;

namespace WS1.Services
{
	public class CustomersServices:IDisposable
    {
        private readonly CustomersRepository _CustomersRepository;

        public CustomersServices()
        {
              _CustomersRepository = new CustomersRepository();
        }

        public IEnumerable<Customers> GetAll()
        {
            return   _CustomersRepository.All();
        }
        public Customers Get(int id)
        {
            return   _CustomersRepository.Single(id);
        }
        public bool Add(Customers product)
        {
            return   _CustomersRepository.Add(product);
        }
        public bool Update(int id, Customers product)
        {
            return   _CustomersRepository.Update(id, product);
        }
        public bool Remove(int id)
        {
            return   _CustomersRepository.RemoveSingle(id);
        }
        public void Dispose()
        {
              _CustomersRepository.Dispose();
        }
    }
}